package com.buydeem.composite;

/**
 * 基础组件接口
 *
 * @author zengchao
 * @date 2022-05-08 11:51:18
 */
public abstract class Component {

    protected String name;

    public Component(String name) {
        this.name = name;
    }

    /**
     * 添加组件
     * @param component
     */
    public void add(Component component){
        throw new UnsupportedOperationException();
    }

    /**
     * 删除组件
     * @param component
     */
    public void remove(Component component){
        throw new UnsupportedOperationException();
    }

    /**
     * 获取薪水
     * @return
     */
    public abstract Integer getSalary();

    /**
     * 打印
     * @param level
     */
    public abstract void print(Integer level);
}
